﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using Hartley.ApplicationLogic;
using Hartley.DTOs;

namespace WebApplication1
{
    public partial class viewStaffById : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            {
            string staffId = Request.QueryString.ToString();
            AdminAL adminAL = new AdminAL();
            if (staffId != "")
            {
                List<StaffDTO> staff = adminAL.GetStaffById(new Guid(staffId)).ToList();
                lblStaffFirstName.Text = staff.SingleOrDefault().FullName;
                lblStaffDOB.Text = staff.SingleOrDefault().DateOfBirth.ToString();
                txtViewStaffPermAdd.Text = staff.SingleOrDefault().Address;
                txtViewStaffDescription.Text = staff.SingleOrDefault().Description;

                lblStaffEmail.Text = staff.SingleOrDefault().Email;
                lblStaffContactNo.Text = staff.SingleOrDefault().PhoneNumber;
                lblStudentSubject.Text = staff.SingleOrDefault().Subject;
                lblStaffDegree.Text = staff.SingleOrDefault().DegreesDetails;
                //lblStudentIndexNo.Text = staff.SingleOrDefault().IndexNo;
                lblStaffJoinedToCollege.Text = staff.SingleOrDefault().TeachFrom.Value.ToShortDateString();
                lblStaffLeftCollege.Text = staff.SingleOrDefault().TeachTo.Value.ToShortDateString();
                // lblStaffHouse.Text = staff.SingleOrDefault().h;
            }
            }
        }
    }
}